package com.aaa.tmr.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import lombok.Data;
import lombok.extern.log4j.Log4j2;

import java.util.ArrayList;
import java.util.List;

/**
 * @author ：Marko
 * @date ：Created in 2021/3/24 10:19
 * @description ：
 * @modified By：
 * @version:
 */
@Data
@Log4j2
public class DataListener extends AnalysisEventListener {

    //导入数据集合
    private List list =new ArrayList();

    @Override
    public void invoke(Object o, AnalysisContext analysisContext) {
        log.info("解析到一条数据:{}"+o);
        list.add(o);

    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        log.info("所有数据解析完成！");
    }
}
